/**
 * @author helio
 */
var SaleChartView = function() {
	this.pieChart;
	this.pieChartStore;
	this.lineChart;
	this.lineChartStore;
	this.columnChart;
	this.columnChartStore;
}

SaleChartView.prototype = {
	showPieChartPanel: function(data) {
		
	},
	
	createLineChartPanel: function(data, title) {
		if(data) {
			this.lineChartStore = new Ext.data.JsonStore({
		        fields:['date', {name: 'amount', type: 'float'}],
		        data: data
		    });
			
			this.lineChart = new Ext.Panel({
		        title: !title ? '线状图' : title,
		        layout:'fit',
				border: false,
		
		        items: {
		            xtype: 'linechart',
		            store: this.lineChartStore,
		            xField: 'date',
		            yField: 'amount'
		        }
		    });
			return this.lineChart;
		} 	
	},
	
	createColumnChartPanel: function(data, title) {
		if(data) {
			this.columnChartStore = new Ext.data.JsonStore({
		        fields:['date', {name: 'amount', type: 'float'}],
		        data: data
		    });
			
			this.columnChart = new Ext.Panel({
		        title: !title ? '柱状图' : title,
		        layout:'fit',
				border: false,
		
		        items: {
		            xtype: 'columnchart',
		            store: this.columnChartStore,
		            xField: 'date',
		            yField: 'amount'
		        }
		    });
			return this.columnChart;
		} 	
	}
}
